package com.zhihesj.anan.base.controller;

import com.sun.corba.se.spi.ior.Identifiable;
import com.zhihesj.anan.base.service.BaseService;
import com.zhihesj.anan.message.Message;
import com.zhihesj.anan.message.MessageCodeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.awt.print.Pageable;

/**
 * @author anan.
 * @version 1.0
 * @create 2020-05-31 09-25
 */
public abstract class BaseControllerImpl<T extends Identifiable,Q extends T> implements BaseController<T,Q> {

    private Logger log = LoggerFactory.getLogger(BaseControllerImpl.class);


    protected abstract BaseService<T> baseService();

    @Override
    @ResponseBody
    @RequestMapping(value = "/delete",method = RequestMethod.DELETE,produces = MediaType.APPLICATION_JSON_VALUE)
    public Message deleteList(String[] ids) {
            return Message.error(MessageCodeEnum.ARRAY_IS_NULL.toString());
    }

    @Override
    public Message deleteOne(String id) {

        return null;
    }

    @Override
    public Message addOne(T entity) {
        return null;
    }

    @Override
    public Message addView() {
        return null;
    }

    @Override
    public Message selectList(Q query, Pageable pageable) {
        return null;
    }

    @Override
    public Message viewOne(String id) {
        return null;
    }

    @Override
    public Message editOne(T entity) {
        return null;
    }

    @Override
    public Message editView(String id) {
        return null;
    }

    @Override
    public Message postAdd(T entity) {
        return null;
    }

    @Override
    public Message postEdit(T entity) {
        return null;
    }
}
